package org.itydl.game.model

import org.itheima.kotlin.game.core.Painter
import org.itydl.game.Config
import org.itydl.game.business.Attackable
import org.itydl.game.business.Blockable
import org.itydl.game.business.Sufferable

/**
 * 模型类
 * 铁块，面向对象思想
 * 墙、草坪、水、坦克都是绘制到窗体上的，公共：位置参数、自身宽高、行为（例如：绘制功能）
 */
class Iron(override val x: Int, override val y: Int) :
        Blockable , Sufferable{ // 铁块具备遭受击打能力，只不过不具备销毁能力

    /**
     * 宽高
     */
    override val width: Int = Config.block
    override val height: Int = Config.block

    override val blood: Int = 1
    /**
     * 行为
     */
    override fun draw() {
        Painter.drawImage("img/steel.gif", x, y)
    }

    override fun notifySuffered(attackable: Attackable): Array<View>? {
        // 遭受打击后，没有任何效果
        return null
    }
}